{nooptimizeoperator}

The {nooptimizeoperator} escape can be used to tell CONNX not to use the prior operator in query optimization. CONNX continues to evaluate the expression, but it is done on the client, rather than potentially using an index, and the associated criteria. For example, using the CONNX sample CUSTOMER table, the following query will be optimized to use the index on CUSTOMERID.  

 

Select * from customers where customerID = 'ALWAO'

 

To tell CONNX not to use the index (to perform a table scan), use the following SQL statement:

 

Select * from customers where customerID = {nooptimizeoperator} 'ALWAO'

 

The {nooptimizeperator} is very useful if you have multiple criterion that have usable indexes, and you want to force a particular index to be used. If there was an index both on the customername and the customerid field, you can force the customerid index to be used as follows:

 

Select * from customers where customerID = 'TEST3' and customername = {nooptimizeoperator} 'Test name 3'

 

Conversely if there was an index both on the customername and the customerid field, you can force the customername index to be used as follows:

 

Select * from customers where customerID = {nooptimizeoperator} and 'TEST3' customername = 'Test name 3'